<?php
/*
 * Created on 24/08/2007
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
?>
<?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'Date') ?>
 <?php use_helper('Javascript')?>
 <?php use_helper('Javascript','Object')?>
<?php echo javascript_include_tag('ajax') ?>
      <table width="600" border="0" align="center" id="externa">
        <tr>
          <td valign="top">
              <table width="600" height="335" border="0" align="center">
                <tr bgcolor="#e1e1e1">
                  <td bgcolor="#e1e1e1" height="10" colspan="2" class="estilo1">Datos Personales</td>
                  <td height="15" colspan="2"></td>
                </tr>

                <tr align="left">
                  <td height="15" colspan="0">&nbsp;&nbsp;</td>
                  <td width="0" align="center">
                  <?php /* echo image_tag('fotos/mario.gif', 'alt=imagen size=130x130') */ ?>
                  </td>
                </tr>
                <tr align="left">
                  <?php echo form_tag('solicitarcitas/datos', array('method' => 'get')) ?>
                  <td height="27">C&eacute;dula:</td>
                  <td height="27" colspan="0">
                     <?php echo input_tag('cedula','') ?>
    				 <?php echo submit_to_remote('buscar', __('Buscar'), array(
    				  'update' => 'datos_estudiantes',
   					  'url' => 'asignarcitas/datos',
   					  'with' => "'ajax=1&cedula=' + $('cedula').value",
   					  //'with' => "'param=' + $('micontenido').value",
  					   )) ?>
                  </td>
                  </form>
                </tr>
                <div>
                <tr height="130" border = "1" aling = "center">
                <?php include_partial('asignarcitas/edit_messages', array('cita' => $cita, 'labels' => $labels)) ?>
                <td id = "datos_estudiantes" height="10" colspan="3"></td>

                </tr>
                </div>
                <tr bgcolor="#e1e1e1">&nbsp;
                  <td height="10" colspan="2" class="estilo1">Datos de la cita</td>
                  <?php echo form_tag('asignarcitas/edit') ?>
                  <?php echo input_hidden_tag('getId') ?>
                  <? $especialista= $sf_user->getAttribute('idsesion') ?>
                  <?php echo input_hidden_tag('especialista_id',$especialista) ?>

                </tr>
                <tr>
                 <td colspan="3">

					<?php include_partial('asignarcitas/edit_messages') ?>

                  </td>
                </tr>
                <tr>
                  <td height="10"></td>
                  <td height="10" colspan="2"></td>
                </tr>
                <tr>
                  <td height="28">Fecha:</td>
                  <td width="0">
                   <? echo input_date_tag('fech',date('Y-m-d'), array('rich' => 'true') ) ?>
                  </td>
                </tr>
                <tr>
                   <td width="15">Especialidad:</td>
                  <td>

                  <?
                    $objsRol = new Rol();
                    $roles = $objsRol->getRolesDeEspecialistas();
                    $this->idEspecialista = $sf_user->getAttribute('idsesion');
                    $objUsu = AteneausuarioPeer::retrieveByPk($this->idEspecialista);
                    $this->rol = RolPeer::retrieveByPk($objUsu->getRolId())->getId();
          			$this->especialidades = $roles;
          			echo input_hidden_tag('rol_id',$this->rol);
          			echo select_tag('rol',objects_for_select($this->especialidades,'getId','getDescripcion',$this->rol),array(
          			'disabled' => 'true',
					'onChange' => remote_function(array(
                    'update' => 'area_especialista',
                    'url' => 'asignarcitas/especialistas',
                    'with' => "'ajax=1&rol='+this.value"
          			))
          			));

            		?>
                  <td>


                    </tr>
       		   	   <tr id="area_especialista" clas="clase">
                   <td width="15">Especialistas:</td>
   				       <td colspan="0">
					  <?
					    $objsAteneausuario = new Ateneausuario();
            			$this->especialistas = $objsAteneausuario->getObjsUsuariosConUnRolId($this->rol);

					  	echo select_tag('especialista',objects_for_select($this->especialistas, 'getId', 'getNombreYDecanato',$this->idEspecialista),array(
					  	'disabled' => 'true',
						'onChange' => remote_function(array(
    			        'update' => 'area_turno',
   			            'url' => 'asignarcitas/turno',
			            'with' => "'ajax=1&especialista='+this.value"
 		         		))
                    	));
  					        ?>
 				         </td>
     	    	    </tr>
       	    	    <tr id="area_turno" class="clase">
       	    	    <td width="15">Turno:</td>
       	    	    <td colspan="0">
			 	 		<?
         				$objsDatoPersonal = new DatoPersonal();
         				$this->turnos = $objsDatoPersonal->getObjsTurnosDeUnUsuarioId($this->idEspecialista);
   					  	echo select_tag('turno',objects_for_select($this->turnos, 'getId', 'getNomTurno'),array(
						'onChange' => remote_function(array(
       					'update' => 'area_horas',
       			        'url' => 'asignarcitas/horas',
      			        'with' => "'ajax=1&turno='+this.value+'&fech='+fech.value"
   		    			))
					  	));
       				   ?>
            		  </td>
       	    	    </tr>

                 </td>

                </tr>

                  <tr id="area_horas" class="clase">
       	    	    <td width="15">Hora:</td>
       	    	    <td colspan="0">
			  		<?
      		  	    echo select_tag('bloque',array(
      		  	    '' => "Seleccione"
      		  	    ));
      		  	    ?>
            		  </td>
       	    	    </tr>

                <tr>
                  <td height="28">Motivo de la Cita:</td>
                  <td colspan=""><textarea name="motivo" cols="50" rows="2" wrap="VIRTUAL"></textarea></td>
                </tr>
                <tr>
                 
                  <td height="28">Tipo de Cita:</td>
                  <?php
					$sf_params->get('rol.value');
                  if (($sf_params->get('rol') == 1) || ($sf_params->get('rol') == 2)) {   ?>
                  <td><select name="tipo" onChange="MM_jumpMenu('parent',this,0)">
                      <option>Tipo de Cita</option>
                      <option selected>Exploratoria</option>
                      <option>Seguimiento</option>
                  </select></td>
                  <? } else {?>
                  <td><select name="tipo" onChange="MM_jumpMenu('parent',this,0)">
                      <option>Tipo de Cita</option>
                      <option selected>Asesoria</option>
                  </select></td>
                  
                  <? } ?>
                  <td></td>
                  <td>
                  
                </tr>
                <tr>
                <td colspan="3" align="center">


				<?php echo submit_tag(__('Registrar'), array (
  				'name' => 'save',
  				'class' => 'sf_admin_action_save',
				)) ?>

				</td>
                </tr>
              </table>

			</form>

			</td>
         </tr>
      </table>

